recomputeStartDate

fun recomputeStartDate(cashFlows: List<ROICashFlowEntry>?, currentBeginDate: Int): Int

Recomputes the start date for a list of cash flows. The start date affects the result of an IRR computation the most, since every cash flow is computed against the start date. There are times when you should recompute the start date because it has been initially estimated, for example when the user picks 'All Dates' in a report and the start date defaults to 1970. This (for example) would make the IRR computation artificially low.

Where the start date has been estimated, or known to be wrong, call this method prior to calling IRR.computeIRR

Note: This function mutates the entries in cashFlows (i.e. start date and annums in period). Clone them first if shared elsewhere.

This function does the following:

Return

The new start date that was computed.

Parameters

cashFlows

The cash flow time series to recompute the start date for, sorted in ascending date order.

currentBeginDate

The current starting date.